package com.example.javapracticaltraining.entity.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import lombok.Data;

/**
 * 
 * @TableName device_spare_parts
 */
@TableName(value ="device_spare_parts")
@Data
public class DeviceSpareParts {
    /**
     * 
     */
    @TableId(value = "part_id", type = IdType.AUTO)
    private Integer partId;

    /**
     * 
     */
    @TableField(value = "part_name")
    private String partName;

    /**
     * 
     */
    @TableField(value = "specification")
    private String specification;

    /**
     * 
     */
    @TableField(value = "model")
    private String model;

    /**
     * 
     */
    @TableField(value = "category_id")
    private Integer categoryId;

    /**
     * 
     */
    @TableField(value = "unit")
    private String unit;

    /**
     * 
     */
    @TableField(value = "stock_quantity")
    private Integer stockQuantity;

    /**
     * 
     */
    @TableField(value = "minimum_quantity")
    private Integer minimumQuantity;

    /**
     * 
     */
    @TableField(value = "purchase_price")
    private BigDecimal purchasePrice;

    /**
     * 
     */
    @TableField(value = "supplier")
    private String supplier;

    /**
     * 
     */
    @TableField(value = "remarks")
    private String remarks;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        DeviceSpareParts other = (DeviceSpareParts) that;
        return (this.getPartId() == null ? other.getPartId() == null : this.getPartId().equals(other.getPartId()))
            && (this.getPartName() == null ? other.getPartName() == null : this.getPartName().equals(other.getPartName()))
            && (this.getSpecification() == null ? other.getSpecification() == null : this.getSpecification().equals(other.getSpecification()))
            && (this.getModel() == null ? other.getModel() == null : this.getModel().equals(other.getModel()))
            && (this.getCategoryId() == null ? other.getCategoryId() == null : this.getCategoryId().equals(other.getCategoryId()))
            && (this.getUnit() == null ? other.getUnit() == null : this.getUnit().equals(other.getUnit()))
            && (this.getStockQuantity() == null ? other.getStockQuantity() == null : this.getStockQuantity().equals(other.getStockQuantity()))
            && (this.getMinimumQuantity() == null ? other.getMinimumQuantity() == null : this.getMinimumQuantity().equals(other.getMinimumQuantity()))
            && (this.getPurchasePrice() == null ? other.getPurchasePrice() == null : this.getPurchasePrice().equals(other.getPurchasePrice()))
            && (this.getSupplier() == null ? other.getSupplier() == null : this.getSupplier().equals(other.getSupplier()))
            && (this.getRemarks() == null ? other.getRemarks() == null : this.getRemarks().equals(other.getRemarks()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getPartId() == null) ? 0 : getPartId().hashCode());
        result = prime * result + ((getPartName() == null) ? 0 : getPartName().hashCode());
        result = prime * result + ((getSpecification() == null) ? 0 : getSpecification().hashCode());
        result = prime * result + ((getModel() == null) ? 0 : getModel().hashCode());
        result = prime * result + ((getCategoryId() == null) ? 0 : getCategoryId().hashCode());
        result = prime * result + ((getUnit() == null) ? 0 : getUnit().hashCode());
        result = prime * result + ((getStockQuantity() == null) ? 0 : getStockQuantity().hashCode());
        result = prime * result + ((getMinimumQuantity() == null) ? 0 : getMinimumQuantity().hashCode());
        result = prime * result + ((getPurchasePrice() == null) ? 0 : getPurchasePrice().hashCode());
        result = prime * result + ((getSupplier() == null) ? 0 : getSupplier().hashCode());
        result = prime * result + ((getRemarks() == null) ? 0 : getRemarks().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", partId=").append(partId);
        sb.append(", partName=").append(partName);
        sb.append(", specification=").append(specification);
        sb.append(", model=").append(model);
        sb.append(", categoryId=").append(categoryId);
        sb.append(", unit=").append(unit);
        sb.append(", stockQuantity=").append(stockQuantity);
        sb.append(", minimumQuantity=").append(minimumQuantity);
        sb.append(", purchasePrice=").append(purchasePrice);
        sb.append(", supplier=").append(supplier);
        sb.append(", remarks=").append(remarks);
        sb.append("]");
        return sb.toString();
    }
}